package com.dsh.config;

import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class OssConfig {

    @Value("${oss.endpoint}")
    private String endpoint;//电脑
    @Value("${oss.accessKeyId}")
    private String accessKeyId;//电脑用户名
    @Value("${oss.accessKeySecret}")
    private String accessKeySecret;//电脑密码


    @Bean
    public OSS OSSClient(){
        // 创建OSSClient实例。                           电脑         电脑用户名    电脑密码
        OSS ossClient = new OSSClientBuilder()
                .build(endpoint, accessKeyId, accessKeySecret);
        return ossClient;
    }
}
